package com.youdianda.controller;

import com.youdianda.dto.LoginDTO;
import com.youdianda.result.Result;
import com.youdianda.service.FrontIndexFgxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "前端登录接口")
@RestController
public class FrontIndexFgxController {
    @Autowired
    private FrontIndexFgxService frontIndexService;
    /**
     * POST 登录接口
     * @return
     */
    @ApiOperation("POST 登录接口")
    @PostMapping("/home/index/login")
    public Result login(@RequestBody LoginDTO dto){
        Result result = frontIndexService.login(dto);
        return result;
    }

    @ApiOperation("get userInfo")
    @GetMapping("/user/getUserInfo")
    public Result getUserInfo(){
        Result result = frontIndexService.getUserInfo();
        return result;
    }
}
